fix: clone input schemas before transforming them#276
fix: clone input schemas before transforming them#276pvdbosch wants to merge 2 commits intoasyncapi:masterfrom
Conversation
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|
|
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |



Description
Transformation from OpenAPI to JSON draft4 schema modifies the input data, even though
cloneSchema: trueis used.This leads to the bug described in #275 when the same schema is transformed multiple times during parsing.
This PR adds a deep clone step before the transformation, and a test case to validate the fix.
Upgrading
@openapi-contrib/openapi-schema-to-json-schemamight also fix this, but it's backwards-incompatible and I'm not well versed in typescript to make the necessary code changes.Related issue(s)
Resolves #275